package pojo;

import util.Verify;

public class ItemAttr {
    public static final String TableName = "pollsys_items";
    private int _itemId;
    public int getItemId() {
        return this._itemId;
    }
    public void setItemId(int itemId) {
        this._itemId    = itemId;
    }
    
    private String _itemName;
    public String getItemName() {
        return this._itemName;
    }
    public void setItemName(String itemName) {
        this._itemName  = itemName.trim();
    }
    
    private int _itemPoll;
    public int getItemPoll() {
        return this._itemPoll;
    }
    public void setItemPoll(int itemPoll) {
        this._itemPoll  = itemPoll;
    }
    
    private String _createTime;
    public String getCreateTime() {
        return this._createTime;
    }
    public void setCreateTime(String createTime) {
        this._createTime    = createTime;
    }
   
    /**
     * 验证信息是否合法 
     */
    public String validate() {
        if(this._itemName.equals("")) {
            return "项目不能为空！";
        }
        if(false == Verify.isValidLen(this._itemName, 40)) {
            return "项目名长度不能超过40个字符！";
        }
        return null; 
    }
}
